package com.shadow.demo;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

@Slf4j
@EnableScheduling
@SpringBootApplication
@MapperScan("com.shadow")
public class ShiroApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ShiroApplication.class, args);
        if (log.isDebugEnabled()) {
            log.debug("系统启动成功");
            Environment env = run.getEnvironment();
            String port = env.getProperty("server.port");
            String contextPath = env.getProperty("server.servlet.context-path");
            String path = "http://localhost:" + port + contextPath;
            log.debug("系统访问地址: {}", path);
            log.debug("网址导航地址: {}", path + "/public/site/index");
        }
    }
}